<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="google-site-verification" content="yaeorbXgKPwp5BDegBtAJEHYWFEFE-BViWTj74gJPrw" />
<!--  -->
<link href="/css/default.css" type="text/css" rel="stylesheet" />
<!--  -->
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/lang/cn.js"></script>
<script type="text/javascript" src="/js/mac/core.min.js"></script>
<title>JQuery MagicCombo 远程加载数据示例</title>
<link type="text/css" rel="stylesheet" href="/css/default/mac/combo/combo.min.css" />
<script type="text/javascript" src="/js/mac/combo.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function(){
	var cfg = {
		keyField: 'no',
		displayField: 'subject',
		multiSelect: false,
		width: 200,
		boxWidth: 200,
		maxHeight: 100, 
		cols : [{
			field: 'subject', width: 198
		}],
		loader: {
			url: '/mac/js/grid/data.php',
			params: { pageSize: 10 },
			autoLoad: true
		}
	};
	var cfg1 = $.extend({}, cfg);
	var cb1 = $('#combo1').mac('combo', cfg1);
	$('#get1').click(function(){
		alert(cb1.selected);
	});
	$('#set1').click(function(){
		cb1.select('2');
	});
});
</script>
<div id="combo1" class="combo"></div><br/>
&nbsp;&nbsp;<button id="get1">get1</button>&nbsp;<button id="set1">set1</button></body>
</html>
